package com.gitee.wsl.mathematics.vector

import com.gitee.wsl.mathematics.vector.ext.mapReduce
import com.gitee.wsl.mathematics.vector.vec2.Vec2f
import com.gitee.wsl.mathematics.vector.vec3.Vec3f
import com.gitee.wsl.mathematics.vector.vec4.Vec4f
import kotlin.test.Test
import kotlin.test.assertEquals

/*
class MapReduceTest {
    @Test
    fun vec2_mapReduce_vectorOnly() =
        assertEquals(-3f, Vec2f(1f, 2f).mapReduce(Float::unaryMinus, Float::plus))

    @Test
    fun vec3_mapReduce_vectorOnly() =
        assertEquals(-6f, Vec3f(1f, 2f, 3f).mapReduce(Float::unaryMinus) { x, y, z -> x + y + z })

    @Test
    fun vec4_mapReduce_vectorOnly() =
        assertEquals(-10f, Vec4f(1f, 2f, 3f, 4f)
            .mapReduce(Float::unaryMinus) { x, y, z, w -> x + y + z + w })

    @Test
    fun vec2_mapReduce_twoVectors() =
        assertEquals(8f, Vec2f(1f, 2f).mapReduce(Vec2f(2f, 3f), Float::times, Float::plus))

    @Test
    fun vec3_mapReduce_twoVectors() =
        assertEquals(20f, Vec3f(1f, 2f, 3f)
            .mapReduce(Vec3f(2f, 3f, 4f), Float::times) { x, y, z -> x + y + z })

    @Test
    fun vec4_mapReduce_twoVectors() =
        assertEquals(40f, Vec4f(1f, 2f, 3f, 4f)
            .mapReduce(Vec4f(2f, 3f, 4f, 5f), Float::times) { x, y, z, w -> x + y + z + w })
}*/
